package com.zhangji.springcloud.service.impl;

import com.zhangji.springcloud.dao.DeptDao;
import com.zhangji.springcloud.pojo.Dept;
import com.zhangji.springcloud.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author: Zhang Ji
 * @Date: 2021/6/22 20:35
 * Created by IntelliJ IDEA.
 */
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptDao;

    @Override
    public Boolean addDept(Dept dept) {
        Boolean aBoolean = deptDao.addDept(dept);
        return aBoolean;
    }

    @Override
    public Dept queryDeptById(Long id) {
        Dept dept = deptDao.queryDeptById(id);
        return dept;
    }

    @Override
    public List<Dept> queryAll() {
        List<Dept> depts = deptDao.queryAll();
        return depts;
    }

}
